package com.cloudfun.campusshare.common.constant;

/**
 * @author wangxiyuan
 * @description 补货状态
 * @createDate 2021/5/19 17:04
 **/
public enum ReplenishStatus {
    DEFAULT(0,""),
    FULL(1,"充足"),
    ALARM(2,"预警"),
    WAIT_REPLENISH(3,"待补货");

    private int code;
    private String message;

    ReplenishStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static ReplenishStatus getTypeByCode(int code){
        for(ReplenishStatus serviceType : ReplenishStatus.values()){
            if(serviceType.code == code){
                return serviceType;
            }
        }
        return null;
    }
}
